package org.eesgmbh.gimv.client.event;

import com.google.gwt.event.dom.client.KeyCodeEvent;


public class KeystrokeEvent extends FilteredDispatchGwtEvent<KeystrokeEventHandler> {

	public static Type<KeystrokeEventHandler> TYPE = new Type<KeystrokeEventHandler>();

	private final KeyCodeEvent gwtKeyCodeEvent;

	public KeystrokeEvent(KeyCodeEvent gwtKeyCodeEvent, KeystrokeEventHandler... blockedHandlers) {
		super(blockedHandlers);

		this.gwtKeyCodeEvent = gwtKeyCodeEvent;
	}

	public KeyCodeEvent getGwtKeyCodeEvent() {
		return this.gwtKeyCodeEvent;
	}

	@Override
	public Type<KeystrokeEventHandler> getAssociatedType() {
		return TYPE;
	}

	@Override
	protected void onDispatch(KeystrokeEventHandler handler) {
		handler.onKeystroke(this);
	}

}
